package cn.sccdlg.spring5.jdbctemplate.jdbctemplate;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/20 23:12
 * JdbcTemplate的最基本用法
 * spring管理下载的JdbcTemplate入门
 */
public class JdbcTemplateDemo2 {

    public static void main(String[] args) {
        //1.获取容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        //2.获取对象
        JdbcTemplate jt = ac.getBean("jdbcTemplate", JdbcTemplate.class);
        //3.执行操作
        jt.execute("insert into account(name,money)values('eee',2222)");

    }
}
